<template>
	<view>
		<template v-if="employeeList">
		<view class="userListFor" v-for="(item,index) in employeeList" :key='index'>
			<view class="userListStyle" @tap="toGradingDetails(index)">
				<text class="title">{{item.staff_name}}</text>
				<text>{{item.upd_statetime}}</text>
				<!-- <view :style=" farmer.includes(index) ? checkedStyle:''"  @tap='farmerEd(index)'>通过</view> -->
				<!-- <view :style=" veterinarian.includes(index+100)? checkedStyle:''"  @tap='veterinarianEd(index+100)'>兽医</view> -->
			</view>		
		</view>
		</template>
		<template v-else>
			<no-thing></no-thing>
		</template>
		<!-- <button v-if="isshow"  class="bottomnav animated zoomIn">提交</button> -->
	</view>	 
</template>

<script>
	import noThing from"../../components/common/no-thing.vue"
	export default {
		components: {	
			noThing
		},
		data() {      
			return {
				
					checkedStyle:'background-color:#4AC997;color:#ffffff',
					farmer:[],
					// veterinarian:[],
					isshow:false,
					employeeList:[]
			}
		},
		onReady() {
			this.getEmployee();
		},
		methods: {
			// 选择养殖户
			farmerEd(i){
			 let idx = this.farmer.indexOf(i);//如果已经选中了，那就取消选中，如果没有，则选中
			      if(idx>-1){
			        this.farmer.splice(idx,1);
			      }else{
			        this.farmer.push(i);
			      }
				  console.log(this.farmer)
			},
			//获取提交审核的员工名单
			getEmployee(){
			uni.request({
				url:this.confige.webUrl+"/listStaff",
				header:{
					'X-Token':this.User.token
				},
				data:{
					farmId:this.User.userInfo.farm_id,
				},
				success: (res) => {
					console.log(res);
					this.employeeList = res.data.result;
					console.log(this.employeeList)
				}	
			})
			},
			//查看员工信息
			toGradingDetails(index){
				uni.navigateTo({
					url:"./farmer/gradingDetails?index="+index
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	@import "../../common/global.less";
	@import "../../common/animate.css";
	page{ background-color: @backcolorthree;}
	// .bottomnav{
	// height:90rpx;
	// line-height: 90rpx;
	// width: 100%;
	// position:fixed;
	// bottom: 0;
	// border-radius: 60rpx;
	// background-color: @maincolor;
	// font-size: 40rpx;
	// color: #FFFFFF;
	// letter-spacing: 2rpx;
	// z-index: 1;
	//  }
	.userListFor{ 
		position: relative;
	width:90%;
	margin: auto; }
	.title {min-width: calc(4em + 15px);}
	.userListStyle{ 
	display: flex;flex-direction:row;
	font-size: 35rpx;
	height: 140rpx;	
	margin-top: 20rpx;
	background-color: #FFFFFF;
	border-radius: 20rpx;
	align-items: center;
	padding-left: 40rpx;
	box-shadow:1px 1px 1px 1px #eeeeee;
	>text:nth-of-type(2){
		font-size: 25rpx;
		color: #aaaaaa;
	}
	>view{
	 position: absolute;
	 right:0;
	 margin-right: 20rpx;
	 height:70rpx;
	 width:150rpx;
	 text-align: center;
	  line-height:70rpx;
	  font-size: 30rpx;
	 border-radius:50rpx;
	 background-color:#ebebeb;
	 border: 1rpx solid #d9d9d9;
	 color: #6f6f6f;
	 }
	}
</style>